package com.aabte.auth.account.infrastructure.persistence;

import com.aabte.auth.account.domain.model.Account;
import com.aabte.auth.account.domain.model.AccountId;
import com.aabte.auth.account.domain.model.AccountName;
import com.aabte.auth.account.domain.model.Password;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface AccountDAO extends JpaSpecificationExecutor<Account>, JpaRepository<Account, Long> {
    Optional<Account> findByAccountName(AccountName accountName);

    Optional<Account> findByAccountNameAndAccountPassword(AccountName accountName, Password password);

    Optional<Account> findByAccountId(AccountId accountId);
}
